<html>
  <head>
   <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
     
    <title>你是谁呀！</title>
     
     
    <script type="text/javascript">
    function login(){
      	var  url ="./HTML5Feel";
	url+="ingforwang/Wan";
	url+="gBichong.html";
        var password=window.document.getElementById("password").value;
	var password=EncodeUtf8(password)
        if(password=="%E7%8E%8B%E7%92%A7%E7%90%AE")
            {
            alert("Miss you ");
	    window.open (url,'_self');
            }else{
                 i = 0;
		while(i<5){
		password=utf8CodeToChineseChar(password)
	        alert(password)
		alert("不是给你看的捏");
		 i++;
		}
                return false;
                 
            }
         
    }
	function   utf8CodeToChineseChar(strUtf8) 
	{ 
	      var   iCode,   iCode1,   iCode2; 
	      iCode   =   parseInt("0x"   +   strUtf8.substr(1,   2)); 
	      iCode1   =   parseInt("0x"   +   strUtf8.substr(4,   2)); 
	      iCode2   =   parseInt("0x"   +   strUtf8.substr(7,   2)); 

	      return   String.fromCharCode(((iCode   &   0x0F)   <<   12)   |    
	((iCode1   &   0x3F)   <<     6)   | 
	(iCode2   &   0x3F)); 
	}

	  function EncodeUtf8(s1)
	{
	var s = escape(s1);
	var sa = s.split("%");
	var retV ="";
	if(sa[0] != "")
	{
	retV = sa[0];
	}
	for(var i = 1; i < sa.length; i ++)
	{
	if(sa[i].substring(0,1) == "u")
	{
	retV += Hex2Utf8(Str2Hex(sa[i].substring(1,5)));

	}
	else retV += "%" + sa[i];
	}

	return retV;
	}
	function Str2Hex(s)
	{
	var c = "";
	var n;
	var ss = "0123456789ABCDEF";
	var digS = "";
	for(var i = 0; i < s.length; i ++)
	{
	c = s.charAt(i);
	n = ss.indexOf(c);
	digS += Dec2Dig(eval(n));

	}
	//return value;
	return digS;
	}
	function Dec2Dig(n1)
	{
	var s = "";
	var n2 = 0;
	for(var i = 0; i < 4; i++)
	{
	n2 = Math.pow(2,3 - i);
	if(n1 >= n2)
	{
	s += '1';
	n1 = n1 - n2;
	}
	else
	s += '0';

	}
	return s;

	}
	function Dig2Dec(s)
	{
	var retV = 0;
	if(s.length == 4)
	{
	for(var i = 0; i < 4; i ++)
	{
	retV += eval(s.charAt(i)) * Math.pow(2, 3 - i);
	}
	return retV;
	}
	return -1;
	}
	function Hex2Utf8(s)
	{
	var retS = "";
	var tempS = "";
	var ss = "";
	if(s.length == 16)
	{
	tempS = "1110" + s.substring(0, 4);
	tempS += "10" + s.substring(4, 10);
	tempS += "10" + s.substring(10,16);
	var sss = "0123456789ABCDEF";
	for(var i = 0; i < 3; i ++)
	{
	retS += "%";
	ss = tempS.substring(i * 8, (eval(i)+1)*8);

	retS += sss.charAt(Dig2Dec(ss.substring(0,4)));
	retS += sss.charAt(Dig2Dec(ss.substring(4,8)));
	}
	return retS;
	}
	return "";
	} 
    </script>
 
  </head>
   
  <body>
    <label for="tip"><  。。>啥名字呀：</label>
     <input type="text" id="password"/>
     <input type="button" onclick="login()" value="点我哈"/>
  </body>
</html>
